#!/usr/bin/env python

import sqlalchemy as sa

from model import DeclarativeBase

__all__ = ['Tag']


class Tag(DeclarativeBase):
    """
    Tag found in post. One tag one record.

    Attributes:
        - id: An integer represent the primary key.
        name: A string of tag.
    """

    __tablename__ = 'tags'

    id = sa.Column(sa.Integer, primary_key=True)
    """
    The primary key

    @type: int
    """

    name = sa.Column(sa.String(255), nullable=False, unique=True, index=True)
    """
    The tag name.

    @type: str
    """
